@echo off
title Running 心灵树洞 - Dev Mode
echo Starting the application...

:: 检查Python是否安装
python --version >nul 2>&1
if %errorlevel% neq 0 (
    echo Error: Python is not installed or not in PATH
    echo Please install Python 3.7+ and try again
    pause
    exit /b 1
)

:: 检查并安装依赖
echo Checking dependencies...
pip show flask >nul 2>&1
if %errorlevel% neq 0 (
    echo Installing Flask...
    pip install flask
)

pip show flask-sqlalchemy >nul 2>&1
if %errorlevel% neq 0 (
    echo Installing Flask-SQLAlchemy...
    pip install flask-sqlalchemy
)

:: 启动应用
echo.
echo ========================================
echo 心灵树洞应用正在启动...
echo ========================================
echo 学生端访问地址: http://localhost:5000
echo 管理员后台: http://localhost:5000/admin
echo 管理员账号: teacher
echo 管理员密码: hearthole2024
echo ========================================
echo.

python app.py

echo.
pause